#include <bits/stdc++.h>
using namespace std;
long long f[1000001][5];
const int M = 1000000007;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 2;
    return 0;
  }
  f[2][1] = f[2][2] = f[2][3] = f[2][4] = 1;
  for (int i = 3; i <= n; i++) {
    f[i][1] = f[i - 1][2];
    f[i][2] = (f[i - 1][4] + f[i - 1][3]) % M;
    f[i][3] = (f[i - 1][4] + f[i - 1][3]) % M;
    f[i][4] = f[i - 1][3];
  }

  cout << (f[n][1] + f[n][2] + f[n][3] + f[n][4]) % M;
  return 0;
}